//
//  AppDelegate.swift
//  Weather
//
//  Created by 王友俊 on 16/3/14.
//  Copyright © 2016年 wangyj. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
        self.window?.backgroundColor = UIColor.whiteColor()
        
        let firstVC = WeatherViewController()
        firstVC.title = "天气"
        let nav1 = UINavigationController(rootViewController:firstVC)
        let image1 = UIImage(named: "weather.png")
        nav1.tabBarItem = UITabBarItem(title: "天气", image: image1, tag: 1)
        
        let secondVC = ChatViewController()
        secondVC.title = "聊天"
        let nav2 = UINavigationController(rootViewController:secondVC)
        let image2 = UIImage(named: "chat.png")
        nav2.tabBarItem = UITabBarItem(title: "聊天", image: image2, tag: 2)
        
        let thirdVC = MyViewController()
        thirdVC.title = "个人中心"
        let nav3 = UINavigationController(rootViewController:thirdVC)
        let image3 = UIImage(named: "my.png")
        nav3.tabBarItem = UITabBarItem(title: "我", image: image3, tag: 3)
        
        
        let navArr = [nav1,nav2,nav3]
        let tabBarController = UITabBarController()
        tabBarController.viewControllers = navArr
        self.window!.rootViewController = tabBarController
        
        
        self.window?.makeKeyAndVisible()
        
        return true
    }

    func applicationWillResignActive(application: UIApplication) {
        
    }

    func applicationDidEnterBackground(application: UIApplication) {
            }

    func applicationWillEnterForeground(application: UIApplication) {
        
    }

    func applicationDidBecomeActive(application: UIApplication) {
        
    }

    func applicationWillTerminate(application: UIApplication) {
    
    }


}

